package org.apache.doris.demo.spring.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
import org.apache.doris.demo.spring.mapper.UserTagMapper;
import org.apache.doris.demo.spring.model.UserTag;
import org.apache.doris.demo.spring.service.UserTagService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service
public class UserTagServiceImpl extends ServiceImpl<UserTagMapper, UserTag> implements UserTagService {
    @Resource
    UserTagMapper userTagMapper;
    @Override
    public void deleteNullColum(String colum) {
        SqlRunner.db().selectOne("set delete_without_partition =  {0}; delete from labelssrc.user_tag_xxx  where "+colum+" is null ;", true);
    }
    public int deleteByMap(Map<String, Object> columnMap) {

        return userTagMapper.deleteByMap(columnMap);
    }
}
